[codex] Inline contracts request-context service shapes#3204
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
🚀 Expo continuous deployment is ready!
|
ApprovabilityA prior Macroscope approval was dismissed. Re-evaluating a7903cf… |
Co-authored-by: codex <codex@users.noreply.github.com>
c295514 to
f71798d
Compare
Dismissing prior approval to re-evaluate f71798d
Dismissing prior approval to re-evaluate a7903cf
…ct-service-foundations [codex] Inline contracts request-context service shapes (pingdotgg#3204)
Summary
EnvironmentAuthenticatedPrincipalrequest-context interface in itsContext.ServicetagRelayClientPrincipalandRelayEnvironmentPrincipalrequest-context interfaces in their tags*Shapeexports and normalize Effect namespace import orderingWhy
These request-context tags exposed duplicate standalone shape names even though Effect already exposes each service interface through
Service["Service"]. Keeping the interface on the tag makes the tag the single source of truth and aligns these contracts with the repository's target Effect service convention.Schema-only exception
packages/contractsis intentionally schema-only. These are context tags consumed by HTTP middleware, not runtime service implementations, so this PR intentionally does not addmakefunctions orLayerexports. Runtime construction remains in the consuming applications.This is a type-organization change only; HTTP error schemas, middleware contracts, wire fields, and runtime behavior are unchanged.
Validation
vp run --filter @t3tools/contracts test(11 files, 161 tests)vp check(passes with 20 pre-existing warnings outside this diff)vp run typecheckNote
Inline service shape types in
RelayClientPrincipalandRelayEnvironmentPrincipalRemoves the
RelayClientPrincipalShapeandRelayEnvironmentPrincipalShapeinterfaces from relay.ts and replaces their generic type parameters with inline object type literals directly on the service classes. No behavioral changes — this is a structural refactor of the type definitions.Macroscope summarized a7903cf.
Note
Low Risk
Contracts-only type organization with identical principal fields and no runtime or wire-format changes.
Overview
Aligns relay HTTP request-context tags with the repo’s Effect service convention by making each
Context.Servicetag the single source of truth for its principal shape.In
relay.ts, removes the exportedRelayClientPrincipalShapeandRelayEnvironmentPrincipalShapeinterfaces and passes those field sets directly as the second generic argument toRelayClientPrincipalandRelayEnvironmentPrincipal. Field names and types are unchanged; only where the type is declared moves.Also reorders imports so
Schemais grouped with the othereffect/*namespace imports (no behavioral impact).Reviewed by Cursor Bugbot for commit a7903cf. Bugbot is set up for automated code reviews on this repo. Configure here.